/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifal.supermercadobarateiro.gui;




/**
 *
 * @author César
 */
public class FrmTelaPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FrmTelaPrincipal
     */
    public FrmTelaPrincipal() {
        initComponents();
        setTitle("Tela Principal");
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlCadastro = new javax.swing.JPanel();
        btnCadastroCliente = new javax.swing.JButton();
        btnCadastroFornecedor = new javax.swing.JButton();
        btnCadastroFuncionario = new javax.swing.JButton();
        btnCadastroProduto = new javax.swing.JButton();
        btnEfetuarVenda = new javax.swing.JButton();
        pnlBusca = new javax.swing.JPanel();
        bntBuscaCliente = new javax.swing.JButton();
        bntBuscaForncedor = new javax.swing.JButton();
        bntBuscaFuncionario = new javax.swing.JButton();
        bntBuscaProduto = new javax.swing.JButton();
        mnuBarra = new javax.swing.JMenuBar();
        mnuCadastro = new javax.swing.JMenu();
        mnuCadastroCliente = new javax.swing.JMenuItem();
        mnuCadastroFornecedor = new javax.swing.JMenuItem();
        mnuCadastroFuncionario = new javax.swing.JMenuItem();
        mnuCadastroProduto = new javax.swing.JMenuItem();
        mnuBusca = new javax.swing.JMenu();
        mnuBuscaCliente = new javax.swing.JMenuItem();
        mnuBuscaFornecedor = new javax.swing.JMenuItem();
        mnuBuscaFuncionario = new javax.swing.JMenuItem();
        mnuBuscaProduto = new javax.swing.JMenuItem();
        mnuVenda = new javax.swing.JMenu();
        mnuVendaEfetuarVenda = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        pnlCadastro.setBorder(javax.swing.BorderFactory.createTitledBorder("Cadastrar"));

        btnCadastroCliente.setText("Cliente");
        btnCadastroCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroClienteActionPerformed(evt);
            }
        });

        btnCadastroFornecedor.setText("Fornecedor");
        btnCadastroFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroFornecedorActionPerformed(evt);
            }
        });

        btnCadastroFuncionario.setText("Funcionário");
        btnCadastroFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroFuncionarioActionPerformed(evt);
            }
        });

        btnCadastroProduto.setText("Produto");
        btnCadastroProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroProdutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlCadastroLayout = new javax.swing.GroupLayout(pnlCadastro);
        pnlCadastro.setLayout(pnlCadastroLayout);
        pnlCadastroLayout.setHorizontalGroup(
            pnlCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCadastroLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnCadastroCliente)
                    .addComponent(btnCadastroFornecedor)
                    .addComponent(btnCadastroFuncionario)
                    .addComponent(btnCadastroProduto))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlCadastroLayout.setVerticalGroup(
            pnlCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCadastroLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnCadastroCliente)
                .addGap(18, 18, 18)
                .addComponent(btnCadastroFornecedor)
                .addGap(18, 18, 18)
                .addComponent(btnCadastroFuncionario)
                .addGap(18, 18, 18)
                .addComponent(btnCadastroProduto)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        btnEfetuarVenda.setText("Efetuar Venda");
        btnEfetuarVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEfetuarVendaActionPerformed(evt);
            }
        });

        pnlBusca.setBorder(javax.swing.BorderFactory.createTitledBorder("Busca"));

        bntBuscaCliente.setText("Cliente");
        bntBuscaCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntBuscaClienteActionPerformed(evt);
            }
        });

        bntBuscaForncedor.setText("Fornecedor");
        bntBuscaForncedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntBuscaForncedorActionPerformed(evt);
            }
        });

        bntBuscaFuncionario.setText("Funcionário");
        bntBuscaFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntBuscaFuncionarioActionPerformed(evt);
            }
        });

        bntBuscaProduto.setText("Produto");
        bntBuscaProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntBuscaProdutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlBuscaLayout = new javax.swing.GroupLayout(pnlBusca);
        pnlBusca.setLayout(pnlBuscaLayout);
        pnlBuscaLayout.setHorizontalGroup(
            pnlBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBuscaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bntBuscaCliente)
                    .addComponent(bntBuscaForncedor)
                    .addComponent(bntBuscaFuncionario)
                    .addComponent(bntBuscaProduto))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlBuscaLayout.setVerticalGroup(
            pnlBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBuscaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(bntBuscaCliente)
                .addGap(18, 18, 18)
                .addComponent(bntBuscaForncedor)
                .addGap(18, 18, 18)
                .addComponent(bntBuscaFuncionario)
                .addGap(18, 18, 18)
                .addComponent(bntBuscaProduto)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        mnuCadastro.setText("Cadastro");

        mnuCadastroCliente.setText("Cliente");
        mnuCadastro.add(mnuCadastroCliente);

        mnuCadastroFornecedor.setText("Fornecedor");
        mnuCadastro.add(mnuCadastroFornecedor);

        mnuCadastroFuncionario.setText("Funcionário");
        mnuCadastro.add(mnuCadastroFuncionario);

        mnuCadastroProduto.setText("Produto");
        mnuCadastro.add(mnuCadastroProduto);

        mnuBarra.add(mnuCadastro);

        mnuBusca.setText("Busca");

        mnuBuscaCliente.setText("Cliente");
        mnuBuscaCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuBuscaClienteActionPerformed(evt);
            }
        });
        mnuBusca.add(mnuBuscaCliente);

        mnuBuscaFornecedor.setText("Fornecedor");
        mnuBusca.add(mnuBuscaFornecedor);

        mnuBuscaFuncionario.setText("Funcionário");
        mnuBusca.add(mnuBuscaFuncionario);

        mnuBuscaProduto.setText("Produto");
        mnuBusca.add(mnuBuscaProduto);

        mnuBarra.add(mnuBusca);

        mnuVenda.setText("Venda");

        mnuVendaEfetuarVenda.setText("Efetuar Venda");
        mnuVenda.add(mnuVendaEfetuarVenda);

        mnuBarra.add(mnuVenda);

        setJMenuBar(mnuBarra);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addComponent(pnlCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(107, 107, 107)
                .addComponent(pnlBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnEfetuarVenda)
                .addGap(150, 150, 150))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(pnlCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                .addComponent(btnEfetuarVenda)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCadastroClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroClienteActionPerformed
    dispose();
    FrmCadastroCliente cad = new FrmCadastroCliente();
    cad.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_btnCadastroClienteActionPerformed

    private void mnuBuscaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuBuscaClienteActionPerformed
    dispose();
    FrmCadastroCliente cad = new FrmCadastroCliente();
    cad.setVisible(true);
    }//GEN-LAST:event_mnuBuscaClienteActionPerformed

    private void btnCadastroFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroFornecedorActionPerformed
        dispose();
        FrmCadastroFornecedor tela = new FrmCadastroFornecedor();
        tela.setVisible(true);
        
                
    }//GEN-LAST:event_btnCadastroFornecedorActionPerformed

    private void btnCadastroFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroFuncionarioActionPerformed
    dispose();
    FrmCadastroFuncionario cad = new FrmCadastroFuncionario();
    cad.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_btnCadastroFuncionarioActionPerformed

    private void btnCadastroProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroProdutoActionPerformed
    dispose();
    FrmCadastroProduto cad = new FrmCadastroProduto();
    cad.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_btnCadastroProdutoActionPerformed

    private void bntBuscaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntBuscaClienteActionPerformed
    dispose();
    FrmBuscaCliente cad = new FrmBuscaCliente();
    cad.setVisible(true);
    }//GEN-LAST:event_bntBuscaClienteActionPerformed

    private void bntBuscaForncedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntBuscaForncedorActionPerformed
        dispose();
        FrmBuscaFornecedor tela = new FrmBuscaFornecedor();
        tela.setVisible(true);
    }//GEN-LAST:event_bntBuscaForncedorActionPerformed

    private void bntBuscaFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntBuscaFuncionarioActionPerformed
    dispose();
    FrmBuscaFuncionario cad = new FrmBuscaFuncionario();
    cad.setVisible(true);
    }//GEN-LAST:event_bntBuscaFuncionarioActionPerformed

    private void bntBuscaProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntBuscaProdutoActionPerformed
    dispose();
    FrmBuscaProduto po = new FrmBuscaProduto();
    po.setVisible(true);
    
    }//GEN-LAST:event_bntBuscaProdutoActionPerformed

    private void btnEfetuarVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEfetuarVendaActionPerformed
        dispose();
        FrmEfetuarVenda ve= new FrmEfetuarVenda();
        ve.setVisible(true);
    }//GEN-LAST:event_btnEfetuarVendaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmTelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmTelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmTelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmTelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmTelaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bntBuscaCliente;
    private javax.swing.JButton bntBuscaForncedor;
    private javax.swing.JButton bntBuscaFuncionario;
    private javax.swing.JButton bntBuscaProduto;
    private javax.swing.JButton btnCadastroCliente;
    private javax.swing.JButton btnCadastroFornecedor;
    private javax.swing.JButton btnCadastroFuncionario;
    private javax.swing.JButton btnCadastroProduto;
    private javax.swing.JButton btnEfetuarVenda;
    private javax.swing.JMenuBar mnuBarra;
    private javax.swing.JMenu mnuBusca;
    private javax.swing.JMenuItem mnuBuscaCliente;
    private javax.swing.JMenuItem mnuBuscaFornecedor;
    private javax.swing.JMenuItem mnuBuscaFuncionario;
    private javax.swing.JMenuItem mnuBuscaProduto;
    private javax.swing.JMenu mnuCadastro;
    private javax.swing.JMenuItem mnuCadastroCliente;
    private javax.swing.JMenuItem mnuCadastroFornecedor;
    private javax.swing.JMenuItem mnuCadastroFuncionario;
    private javax.swing.JMenuItem mnuCadastroProduto;
    private javax.swing.JMenu mnuVenda;
    private javax.swing.JMenuItem mnuVendaEfetuarVenda;
    private javax.swing.JPanel pnlBusca;
    private javax.swing.JPanel pnlCadastro;
    // End of variables declaration//GEN-END:variables
}
